home *** CD-ROM | disk | FTP | other *** search
- global oIndexScroller, gGlobalStepCount, gLocalStepCount, gInputField, gModeState, gAlphaState, gCurrEntryAttrib, gNewSetIsHereF, gchunksize, gFirstHotWord, gEpisFTchunksizeK, oIndexMediator, gTheFTword, gFTsearchscope, gModeNameLU, gNumofHits, gStatusField, gStardateLU, gStardLUlistSize, gFTstartSND, gESstartSND, gIndexSND, oTextScroller, gIndxScrollFldK, gTheMseWord, gActiveResTopWin, gAposCurlyQ, gBeginCurlyQ, gEndCurlyQ, gComputerTypeK, gdescfield
-
- on hFilterSearchChars pTheChars
- if pTheChars = EMPTY then
- hReportStatus("Sorry, I can't find that.")
- hearit(gNopeSND)
- abort()
- end if
- if gModeState = #CHRO then
- if char 1 of pTheChars = "•" then
- if char 2 of pTheChars = " " then
- set lk to string(18)
- else
- set lk to string(24)
- end if
- else
- set lk to char 1 to 2 of pTheChars
- if value(lk) > 23 then
- set lk to string(24)
- end if
- end if
- else
- if gModeState = #EPIS then
- set lk to char 2 of pTheChars
- else
- if gModeState = #FoundSet then
- set Lchar to char 1 of pTheChars
- if Lchar = "•" then
- set lk to string(18)
- else
- if (value(Lchar) >= 1) and (value(Lchar) <= 9) then
- set Lk2v to value(char 2 of pTheChars)
- if (value(Lchar) >= 0) and (value(Lchar) <= 9) then
- set lk to char 1 to 2 of pTheChars
- end if
- else
- if (Lchar = "“") or (Lchar = " ") then
- set lk to char 2 of pTheChars
- else
- set lk to Lchar
- end if
- end if
- end if
- set lk to hCapitalize(lk)
- else
- if (gModeState = #Resources) or (gModeState = #TOPICS) then
- set lk to "A"
- else
- set lk to hCapitalize(char 1 of pTheChars)
- end if
- end if
- end if
- end if
- return lk
- end
-
- on hIsaStardate pNumber
- if not objectp(gStardateLU) then
- return(void)
- end if
- set Lmyloc to findPosNear(gStardateLU, value(pNumber))
- if Lmyloc <= gStardLUlistSize then
- return getAt(gStardateLU, Lmyloc)
- else
- return(void)
- end if
- end
-
- on hInitCurlyQ
- if gComputerTypeK = #WIN then
- set gBeginCurlyQ to numToChar(65427)
- set gEndCurlyQ to numToChar(65428)
- set gAposCurlyQ to numToChar(65426)
- else
- set gBeginCurlyQ to numToChar(210)
- set gEndCurlyQ to numToChar(211)
- set gAposCurlyQ to numToChar(213)
- end if
- end
-
- on hIsanEpisode pChunk, pthisword
- if pChunk contains gBeginCurlyQ then
- set Lsize to the number of words in pChunk
- set Loffset to pthisword - gEpisFTchunksizeK
- set Lstart to 0
- repeat with vWordCount = pthisword down to Loffset
- if vWordCount = pthisword then
- set vHoldword to word vWordCount of field gdescfield
- set vHoldword to hZapEnd(vHoldword, charToNum(gEndCurlyQ))
- else
- set vHoldword to word vWordCount of field gdescfield
- end if
- if vHoldword contains gBeginCurlyQ then
- set Lstart to vWordCount
- exit repeat
- end if
- end repeat
- if Lstart = 0 then
- return 0
- end if
- set Loffset to pthisword + gEpisFTchunksizeK
- repeat with vWordCount = pthisword to Loffset
- if vWordCount = pthisword then
- set vHoldword to word vWordCount of field gdescfield
- set vHoldword to hZapEnd(vHoldword, charToNum(gBeginCurlyQ))
- else
- set vHoldword to word vWordCount of field gdescfield
- end if
- if char length(vHoldword) of vHoldword = gEndCurlyQ then
- set Lend to vWordCount
- exit repeat
- end if
- end repeat
- if Lend = 0 then
- return 0
- end if
- set Lgotcha to word Lstart to Lend of field gdescfield
- if word 1 of Lgotcha starts "(" then
- delete char 1 of word 1 of Lgotcha
- end if
- set vCheckingEpis to word Lend + 1 of field gdescfield
- if (vCheckingEpis contains "TNG") or (vCheckingEpis contains "DS9") or (vCheckingEpis contains "TOS") or (vCheckingEpis contains "VGR") then
- return Lgotcha
- else
- return 0
- end if
- else
- if pChunk contains "(Star" then
- set Lsize to the number of words in pChunk
- set Loffset to pthisword - gEpisFTchunksizeK
- set Lstart to 0
- repeat with vWordCount = pthisword down to Loffset
- set vHoldword to word vWordCount of field gdescfield
- if vHoldword contains "(Star" then
- set Lstart to vWordCount
- exit repeat
- end if
- end repeat
- if Lstart = 0 then
- return 0
- end if
- set Loffset to pthisword + gEpisFTchunksizeK
- repeat with vWordCount = pthisword to Loffset
- set vHoldword to word vWordCount of field gdescfield
- if char length(vHoldword) - 1 of vHoldword = ")" then
- set Lend to vWordCount
- exit repeat
- end if
- end repeat
- if Lend = 0 then
- return 0
- end if
- set Lgotcha to word Lstart to Lend of field gdescfield
- set vLastWord to word the number of words in Lgotcha of Lgotcha
- set vLastWord to hZapEnd(vLastWord, 46)
- set vLastWord to hZapEnd(vLastWord, 41)
- set Lgotcha to word Lstart to Lend - 1 of field gdescfield && vLastWord
- if word 1 of Lgotcha starts "(" then
- delete char 1 of word 1 of Lgotcha
- end if
- set Lgotcha to numToChar(32) & Lgotcha
- return Lgotcha
- else
- return 0
- end if
- end if
- end
-
- on hZapBegin vEntry, vCharacter
- repeat while charToNum(char 1 of vEntry) = vCharacter
- delete char 1 of vEntry
- end repeat
- return vEntry
- end
-
- on hZapEnd vEntry, vCharacter
- if charToNum(char length(vEntry) of vEntry) = vCharacter then
- delete char length(vEntry) of vEntry
- end if
- return vEntry
- end
-
- on hZapThroughOut vEntry, vCharacter
- repeat with n = 1 to length(vEntry)
- if charToNum(char n of vEntry) = vCharacter then
- delete char n of vEntry
- end if
- end repeat
- return vEntry
- end
-
- on hFillInputField pWithMe
- put hcleanup(pWithMe) into field gInputField
- hilite char 999 of field gInputField
- end
-
- on hGetMode pNtry
- set pNtry to string(pNtry)
- set Lc1 to char 1 of pNtry
- if hIsaQuote(Lc1) or (Lc1 = " ") then
- return #EPIS
- else
- if hIsaRomanDate(pNtry) then
- return #CHRO
- else
- if Lc1 = "•" then
- return #CHRO
- else
- return #ENCY
- end if
- end if
- end if
- end
-
- on hDetectMode pNtry
- hSetMode(#ENCY)
- return 1
- end
-